package com.itheima.io.objectoutputstream.demo01;

import java.io.Serializable;

/**
 * Serializable这个接口被称之序列化接口，其中没有定义任何的抽象方法，那么我们把这样的接口称之为"标记型接口"
 */
public class Student implements Serializable  {

    // 给当前类显示的去指定了一个serialVersionUID
    private static final long serialVersionUID = 7859708848226797684L;

    private String name ;

    private int age ;

    private transient String address ;            // 不想让这个字段被序列化

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public Student() {
    }

    public Student(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public Student(String name, int age, String address) {
        this.name = name;
        this.age = age;
        this.address = address;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }


    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", address='" + address + '\'' +
                '}';
    }

}
